home *** CD-ROM | disk | FTP | other *** search
- connect "e:\sst\articles\9708\code\demo.gdb"
- user "SYSDBA" password "masterkey";
-
- create generator Gen_CreditNo;
- create generator Gen_PaymentNo;
- commit;
-
- drop table PaymentMethods;
- create table PaymentMethods
- (
- PayMethodCode char(2) not null primary key,
- PayMethodName char(20) not null,
- Sequence smallint not null
- );
- commit;
-
- insert into PaymentMethods values ('CS', 'Cash', 1);
- insert into PaymentMethods values ('CK', 'Personal Check', 2);
- insert into PaymentMethods values ('TC', 'Traveler''s Check', 3);
- insert into PaymentMethods values ('CC', 'Cashier''s Check', 4);
- insert into PaymentMethods values ('OT', 'Other', 5);
-
- drop table Credits;
- create table Credits
- (
- CreditNo integer not null primary key,
- Status char(1) default 'V' not null,
- CustNo integer not null,
- Amount float default 0 not null,
- BalanceDue float default 0 not null,
- IssueDateTime date default 'now' not null
- );
- commit;
-
- drop table Payments;
- create table Payments
- (
- PaymentNo integer not null primary key,
- CustNo integer not null,
- Amount float default 0 not null,
- PaymentDateTime date default 'now' not null
- );
- commit;
-
- drop table PaymentCredits;
- create table PaymentCredits
- (
- PaymentNo integer not null,
- CreditNo integer not null,
- Amount float not null,
- BalanceDue float not null,
- primary key (PaymentNo, CreditNo)
- );
- commit;
-
- drop table PaymentAllocation;
- create table PaymentAllocation
- (
- PaymentNo integer not null,
- CreditNo integer not null,
- PayMethodCode char(2) not null,
- Amount float not null,
- primary key (PaymentNo, CreditNo, PayMethodCode)
- );
- commit;
-
- exit;
-
-